using System;using System.Data;using System.Data.SqlClient;using System.Collections.Generic;namespace MyWeb.Data{	public class TabsDAL : SqlDataProvider	{		#region[Tabs_GetById]		public List<Tabs> Tabs_GetById(string Id)		{			List<Data.Tabs> list = new List<Data.Tabs>();			using (SqlCommand dbCmd = new SqlCommand("sp_Tabs_GetById", GetConnection()))			{				Data.Tabs obj = new Data.Tabs();				dbCmd.CommandType = CommandType.StoredProcedure;				dbCmd.Parameters.Add(new SqlParameter("@Id", Id));				SqlDataReader dr = dbCmd.ExecuteReader();				if (dr.HasRows)				{					while (dr.Read())					{						list.Add(obj.TabsIDataReader(dr));					}
                }
                dr.Close();
                //conn.Close();			}			return list;		}		#endregion		#region[Tabs_GetByTop]		public List<Tabs> Tabs_GetByTop(string Top, string Where, string Order)		{			List<Data.Tabs> list = new List<Data.Tabs>();			using (SqlCommand dbCmd = new SqlCommand("sp_Tabs_GetByTop", GetConnection()))			{				Data.Tabs obj = new Data.Tabs();				dbCmd.CommandType = CommandType.StoredProcedure;				dbCmd.Parameters.Add(new SqlParameter("@Top", Top));				dbCmd.Parameters.Add(new SqlParameter("@Where", Where));				dbCmd.Parameters.Add(new SqlParameter("@Order", Order));				SqlDataReader dr = dbCmd.ExecuteReader();				if (dr.HasRows)				{					while (dr.Read())					{						list.Add(obj.TabsIDataReader(dr));					}
                }
                dr.Close();
                //conn.Close();			}			return list;		}		#endregion		#region[Tabs_GetByAll]		public List<Tabs> Tabs_GetByAll(string Lang)		{			List<Data.Tabs> list = new List<Data.Tabs>();			using (SqlCommand dbCmd = new SqlCommand("sp_Tabs_GetByAll", GetConnection()))			{				Data.Tabs obj = new Data.Tabs();				dbCmd.CommandType = CommandType.StoredProcedure;				dbCmd.Parameters.Add(new SqlParameter("@Lang", Lang));				SqlDataReader dr = dbCmd.ExecuteReader();				if (dr.HasRows)				{					while (dr.Read())					{						list.Add(obj.TabsIDataReader(dr));					}
                }
                dr.Close();
                //conn.Close();			}			return list;		}		#endregion		#region[Tabs_Paging]		public List<Tabs> Tabs_Paging(string CurentPage, string PageSize, string Lang)		{			List<Data.Tabs> list = new List<Data.Tabs>();			using (SqlCommand dbCmd = new SqlCommand("sp_Tabs_Paging", GetConnection()))			{				Data.Tabs obj = new Data.Tabs();				dbCmd.CommandType = CommandType.StoredProcedure;				dbCmd.Parameters.Add(new SqlParameter("@CurentPage", CurentPage));				dbCmd.Parameters.Add(new SqlParameter("@PageSize", PageSize));				dbCmd.Parameters.Add(new SqlParameter("@Lang", Lang));				SqlDataReader dr = dbCmd.ExecuteReader();				if (dr.HasRows)				{					while (dr.Read())					{						list.Add(obj.TabsIDataReader(dr));					}
                }
                dr.Close();
                //conn.Close();			}		    return list;		}		#endregion		#region[Tabs_Insert]		public bool Tabs_Insert(Tabs data)		{			using (SqlCommand dbCmd = new SqlCommand("sp_Tabs_Insert", GetConnection()))			{				dbCmd.CommandType = CommandType.StoredProcedure;				dbCmd.Parameters.Add(new SqlParameter("@Name", data.Name));
			    dbCmd.Parameters.Add(new SqlParameter("@Tag", data.Tag));				dbCmd.Parameters.Add(new SqlParameter("@IsDownloads", data.IsDownloads));				dbCmd.Parameters.Add(new SqlParameter("@Active", data.Active));				dbCmd.Parameters.Add(new SqlParameter("@Lang", data.Lang));				dbCmd.ExecuteNonQuery();			}			//Clear cache			System.Web.HttpContext.Current.Cache.Remove("Tabs");			return true;		}		#endregion		#region[Tabs_Update]		public bool Tabs_Update(Tabs data)		{			using (SqlCommand dbCmd = new SqlCommand("sp_Tabs_Update", GetConnection()))			{				dbCmd.CommandType = CommandType.StoredProcedure;				dbCmd.Parameters.Add(new SqlParameter("@Id", data.Id));				dbCmd.Parameters.Add(new SqlParameter("@Name", data.Name));
                dbCmd.Parameters.Add(new SqlParameter("@Tag", data.Tag));				dbCmd.Parameters.Add(new SqlParameter("@IsDownloads", data.IsDownloads));				dbCmd.Parameters.Add(new SqlParameter("@Active", data.Active));				dbCmd.Parameters.Add(new SqlParameter("@Lang", data.Lang));				dbCmd.ExecuteNonQuery();			}			//Clear cache			System.Web.HttpContext.Current.Cache.Remove("Tabs");			return true;		}		#endregion		#region[Tabs_Delete]		public bool Tabs_Delete(string Id)		{			using (SqlCommand dbCmd = new SqlCommand("sp_Tabs_Delete", GetConnection()))			{				dbCmd.CommandType = CommandType.StoredProcedure;				dbCmd.Parameters.Add(new SqlParameter("@Id", Id));				dbCmd.ExecuteNonQuery();			}			//Clear cache			System.Web.HttpContext.Current.Cache.Remove("Tabs");			return true;		}		#endregion			}}